# https://github.com/mpv-player/mpv/blob/master/etc/input.conf
#########################
# Useful Links
######
# https://mpv.io/manual/master/#javascript
###
# dotfiles
##
# https://github.com/duckpuppy/dotfiles/tree/master/.config/mpv
##

#########################
# mpv > keyboard shortcut / binding file
#
# NOTE: `meta` refers to the `⌘` on macOS
#
# NOTE: to call a script within ~/.config/mpv/scripts using a binding
# ...ex: "<key-binding> script_binding <script_name.{js,lua}>"
#
# NOTE: use [KEY] `ignore` ie. `R ignore`
##

# How to turn off subtitles for a video?
# ANSWER subtitle display can be toggled with `v`
# ANSWER to cycle through the onscreen subtitles, `j` ie. different langs

# NOTE:
# `T` cycle ontop # keep video window ontop of other windows
shift+T cycle ontop
# T cycle ontop
# t ignore
# t-t cycle ontop

# Volume on mouse wheel
# WHEEL_UP   add volume 2
# WHEEL_DOWN add volume -2

### seeking ###
# relative
RIGHT osd-msg-bar seek 5 exact
LEFT osd-msg-bar seek -5 exact
# jump to beginning of playback, ie. the start of a file
g-g seek 0 absolute 
# TODO: fixme
shift+G seek 100 absolute-percent


### seeking TODO ###
# TODO setup a keybinding to seek in one minute increments

### Volume ###
# NOTE: the below two bindings will remove or override the default bindings of seeking through the video. YT has etched my noodle
UP osd-msg-bar add volume 5
DOWN osd-msg-bar add volume -5

### axis ###
AXIS_UP add volume 2
AXIS_DOWN add volume -2

### seeking ###
AXIS_LEFT seek 5 exact
AXIS_RIGHT seek -5 exact

### rotation ###
# rotate video counterclockwise
# NOTE: `left` refers to the left arrow key, ←
meta+shift+left add video-rotate -90

# rotate video clockwise
# NOTE: `right` refers to the right arrow key, →
meta+shift+right add video-rotate 90

### sizing ###
# adjust window size
meta+] multiply window-scale 1.1
meta+[ multiply window-scale 0.9

# zoom window
meta+= add video-zoom 0.25
meta+- add video-zoom -0.25

# NOTE: key-bindings can directly be set within a script file itself.

# TODO: conjure up a key-binding that calls a script to save the window size and placement.
# TODO; conjure up a script that loads the previously saved settings into the current instance of mpv

# NOTE: the below keybinding is a useful DEBUG for on screen messages
# meta+s show-text "some freaking overlay text"

# macOS / MBP > Media Keys
PAUSE cycle pause
PLAYPAUSE cycle pause

### playback & jelly ###
# YouTube playback speed FTW  ...relative to current pb speed
Shift+> multiply speed 1.1
Shift+< multiply speed 0.9

# NOTE: playback speed absolute
#  mash `delete` / `backspace` to reset pb&j to 1.0

### playback > audio streams
# NOTE: useful for working with media files that contain multiple audio stream
# To list / print available video & audio streams
# (fn)F9
# NOTE: keyboard with media keys defined to the function keys may require an additional key press
# To cycle / play the next audio track
# (shift)+3 or `#`

### playback > recording playback of mpv
# Ctrl+R run "/opt/code/dotfiles/jobs/bin/record.sh"
# 0x12 run "/opt/code/dotfiles/jobs/bin/record.sh" # Ctrl + r, ie. caps lock + r for my key latout
# 0x18 run "/opt/code/dotfiles/jobs/bin/record_stop.sh" # capslock + x for my key layout
r ignore # remove any previous bindings for the `r` key
# shift+r ignore # remove any previous bindings for `shift+r`
#

# NOTE: for whatever reason the stop recording key binding / macro has to be mashed twice.
r run "/opt/code/dotfiles/jobs/bin/record.sh"
# shift+r run "/opt/code/dotfiles/jobs/bin/record_stop.sh"

################
# Sample: `input.conf`
#...https://github.com/FichteFoll/dotfiles/blob/master/mpv/.config/mpv/input.conf
# 
